
<div class="x_panel">
  <div class="x_content" style="display: block;">
    <!--表格主体内容-->
    <div class="row-fluid">
      <form action="/order/customer-service.html" method="get">
        <label class="control-label">申请单号</label>
        <input type="text" class="form-control-new" name="form[service_no]" value="{if isset($query.service_no)}{$query.service_no}{/if}">
        <label class="control-label">手机号</label>
        <input type="text" class="form-control-new" name="form[mobile]" value="{if isset($query.mobile)}{$query.mobile}{/if}">
        <label class="control-label">订单号</label>
        <input type="text" class="form-control-new" name="form[order_no]" value="{if isset($query.order_no)}{$query.order_no}{/if}">
        <label class="control-label">商品名称</label>
        <input type="text" class="form-control-new" name="form[goods_name]" value="{if isset($query.goods_name)}{$query.goods_name}{/if}">

        <label class="control-label">退货状态</label>
        <select  class="form-control-new" name="form[yanxuan_status]" >
          <option {if !isset($query.yanxuan_status) || $query.yanxuan_status==0}selected="selected"{/if} value="0">全部</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==1}selected="selected"{/if} value="1">待审核</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==2}selected="selected"{/if} value="2">待用户寄回</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==3}selected="selected"{/if} value="3">用户已寄送</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==4}selected="selected"{/if} value="4">退货成功</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==5}selected="selected"{/if} value="5">客服审核不通过</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==6}selected="selected"{/if} value="6">用户取消</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==7}selected="selected"{/if} value="7">系统取消</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==8}selected="selected"{/if} value="8">客服取消</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==9}selected="selected"{/if} value="9">待客服确认</option>
          <option {if isset($query.yanxuan_status) && $query.yanxuan_status==11}selected="selected"{/if} value="11">客服拒绝</option>
        </select>

        <label class="control-label">打款状态</label>
        <select  class="form-control-new" name="form[is_refund]" >
          <option {if !isset($query.is_refund) || $query.is_refund==-1}selected="selected"{/if} value="-1">全部</option>
          <option {if isset($query.is_refund) && $query.is_refund==0}selected="selected"{/if} value="0">未打款</option>
          <option {if isset($query.is_refund) && $query.is_refund==1}selected="selected"{/if} value="1">已打款</option>
        </select>


        <label class="control-label">申请时间</label>
        <input type="text"  name="form[start_time]" value="{if isset($query.start_time)}{$query.start_time}{/if}" placeholder="开始时间" id="J_dh_start" class="form-control-new" >
        <input type="text"  name="form[end_time]" value="{if isset($query.end_time)}{$query.end_time}{/if}" placeholder="结束时间" id="J_dh_end" class="form-control-new" >
        <button name="submit" type="submit" class="btn btn-primary" value="search">查询</button>
        <button name="submit" value="export" type="submit" class="btn btn-primary" >导出</button>
      </form>



    </div>
    <br>
    <div class="cont">
      <table class="table table-bordered table-striped">
        <thead>
        <tr>
          <th>申请单号</th>
          <th>手机号</th>
          <th>订单号</th>
          <th>商品名称</th>
          <th>商品数量</th>
          <th>退款金额</th>
          <th>退货状态</th>
          <th>退货原因</th>
          <th>申请时间</th>
          <th>是否已打款</th>
          <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $order.lists as $orderitem}
        <tr>
          <td>{$orderitem.service_no}</td>
          <td>{$orderitem.mobile}</td>
          <td>{$orderitem.order_no}</td>
          <td>{$orderitem.goods_name}</td>
          <td>{$orderitem.sku_num}</td>
          <td>{$orderitem.service_amount}</td>
          <td>
            {if $orderitem.yanxuan_status==1}待审核
            {elseif $orderitem.yanxuan_status==2}待用户寄回
            {elseif $orderitem.yanxuan_status==3}用户已寄送
            {elseif $orderitem.yanxuan_status==4}退货成功
            {elseif $orderitem.yanxuan_status==5}客服审核不通过
            {elseif $orderitem.yanxuan_status==6}用户取消
            {elseif $orderitem.yanxuan_status==7}系统取消
            {elseif $orderitem.yanxuan_status==8}客服取消
            {elseif $orderitem.yanxuan_status==9}待客服确认
            {elseif $orderitem.yanxuan_status==11}客服拒绝
            {/if}
          </td>
          <td>{if $orderitem.reason_type==0}无理由{else}质量问题{/if}</td>
          <td>{$orderitem.service_time}</td>
          <td>
            {if $orderitem.is_refund==1}已打款
            {else}未打款
            {/if}
          </td>
          <td>
            <div class="x_content">
              <a class="btn btn-primary btn-xs" href="{eval U(['order/service-detail','id'=>$orderitem.service_id])}"> 查看详情</a>
              {if $orderitem.is_refund==0 && $orderitem.yanxuan_status==4}
              <button class="btn btn-danger btn-xs" data-toggle="dropdown">打款
                <i class="icon-angle-down"></i></button>
              <ul class="dropdown-menu">
                <li><a href="{eval U(['order/refund','id'=>$orderitem.service_id])}">确定</a></li>
                <li><a href="javascript:;">取消</a></li>
              </ul>
              {/if}
            </div>
          </td>
        </tr>
        {/foreach}
        </tbody>
      </table>
      <!--分页-->
      {Yii::$app->view->render('/com/pager.php',['pager'=>$order.pager])}

    </div>




  </div>
</div>
<script type="text/javascript" src="{$theme}/libs/js/datepicker/bootstrap-datetimepicker.min.js"></script>
<script>
    var startDate = $('#J_dh_start').datetimepicker({
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
    })

    var endDate = $('#J_dh_end').datetimepicker({
        format: "yyyy-MM-dd",
        autoclose: true,
        todayBtn: true,
        minView: 2,
    })

</script>